package ai.people.platform.jx.controller;


import ai.people.core.common.util.IpAddressUtil;
import ai.people.netmon.framework.model.response.Result;
import ai.people.netmon.framework.utils.ResultUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 *  账号地理位置相关接口
 * @author LiGuanNan
 * @date 2022/5/31 下午2:23
 */
@Slf4j
@RestController
@RequestMapping("v1/tool")
public class ToolController {

    /**
     * 获取客户端真实ip
     */
    @GetMapping(value = "/client-real-ip")
    public Result<String> getClientRealIp(HttpServletRequest request) {
        return ResultUtil.success(IpAddressUtil.getIpAddress(request));
    }


}
